﻿namespace ConsoleHost
{
    public class DataStorageSettings
    {
        private string address;
        private string initialCatalog;
        private string password;
        private string port;
        private string userId;

        public DataStorageSettings()
        {
            LoadData();
        }

        public string Address
        {
            get { return address; }
        }

        public string InitialCatalog
        {
            get { return initialCatalog; }
        }

        public string Password
        {
            get { return password; }
        }

        public string Port
        {
            get { return port; }
        }

        public string UserId
        {
            get { return userId; }
        }

        public string ConnectionString
        {
            get
            {
                return string.Format(
                    "Data Source={0},{1};Network Library=DBMSSOCN;Initial Catalog={2};User ID={3};Password={4}",
                    Address, Port, InitialCatalog, UserId, Password);
            }
        }

        public void LoadData()
        {
            address = "192.168.1.103";
            port = "1433";
            initialCatalog = "EFRepository.EFContext";
            userId = "tuser";
            password = "user";
        }
    }
}